﻿using System;
using Unity.Netcode;
using UnityEngine;


[Serializable]
public class AddGunEffect : IPropEffect
{
    public void OnUse(Knight knight)
    {        
        if(knight!=null && knight.TryGetComponent<WeaponManager>(out var manager))
        {
            manager.AddWeapon();
        }
        else
        {
            
            Debug.LogError($"target don't contain WeaponManager");
        }
    }
}

[CreateAssetMenu(fileName ="AddGunProp",menuName ="SO/Prop/AddGunProp")]
public class AddGunProp : PropData
{
    protected override void Reset()
    {
        Effect ??= new AddGunEffect();
    }
}